package com.gitee.sidihuo.platform.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class EnvHelper {

    public static String LOCAL = "local";
    public static String DEV = "dev";
    public static String SIT = "sit";
    public static String PT = "pt";
    public static String UAT = "uat";
    public static String PRD = "prd";


    public static String ENV;

    public static boolean ISPRD;

    @Value("${app.env}")
    private synchronized void setEnv(String configenv) {
        ENV = configenv;
    }

    @Value("${app.env}")
    private synchronized void setIsPrd(String env) {
        ISPRD = env.equalsIgnoreCase(EnvHelper.PRD) ? true : false;
    }
}
